/**
 * Differencer.cpp
 * Coyright (c) 2009 Xiaofeng Gu. All Rights Reserved.
 * Author : Xiaofeng Gu
 *
 * Creation Data : 2009/06/11
 */

#include "stdafx.h"
#include "Differencer.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

HRESULT CDifferencer::OnExecute()
{
	HRESULT hr = S_OK;
	hr = __super::OnExecute();
	if (hr != S_OK)
	{
		return hr;
	}

	CDifferencerProcessCard* pDifferencerProcessCard= GetBlockInfo<CDifferencerProcessCard>(DIFFERENCERPROCESSCARD);
	Families* pFamiles = pDifferencerProcessCard->GetFamilies();
	for (Families::iterator itFa = pFamiles->begin(); itFa != pFamiles->end(); itFa ++)
	{
		CFamily* pFamily = *itFa;

		Knots* pKnots = pFamily->GetKnots();

		long lCount = (long)(pKnots->size());
		for (long i = 0; i < lCount-1; i ++)
		{
			*((*pKnots)[i]) - *((*pKnots)[i + 1]);
		}
	}

	return S_OK;
}